#pragma once
#include "common.h"
#include "Vec2.h"
#include "threatData.h"
#define FIVE 1
#define NON_FIVE 0
class Board
{
	static vector<threatData*> vThreatData;
	char** board_;
	unsigned int size_;
	//stack<Vec2> traceGain;
public:
	Board();
	~Board();
	friend ostream& operator<<(ostream& os, Board& board);
	static void initThreatData();
	static void clearThreatData();
	void setSize(unsigned int);
	void setValue(unsigned int row,unsigned int collumn,char value);
	char getValue(unsigned int row, unsigned int collumn);
	char getValue(Vec2);
	char getValue(unsigned int row, unsigned int collumn, DIRECTION direct,int offset);
	void setBlank(vector<Vec2> v);
	int threatSearch(unsigned int row, unsigned int collumn, char type,vector<Vec2>& traceGain );
	bool win(unsigned int  row, unsigned int collumn, char type);
	char getOppositeType(char);

	bool inBoard(unsigned int row, unsigned int collumn);
	char* getLine(unsigned int row, unsigned int collumn,DIRECTION direction);
	Vec2 getPosition(unsigned int row, unsigned int collumn, DIRECTION direction, int offset);
	int findGain(unsigned int row, unsigned int collumn,char type, DIRECTION direction, vector<Vec2>&gain);

	Vec2 getNextMove();
};

